myApp.factory('$serAccessSignin', function ($localStorage ,$serApiSend) {
    return {
        getUser:function(){
            if(!!$localStorage.userInfo){
                return $localStorage.userInfo
            }else{
                return false
            }
        },
        setUser:function(data){
            var send = $serApiSend(data,'Login/login');
            send.then(function(res){
                if(res.code == 1){
                    $localStorage.userInfo = res.data;
                }else {
                    $localStorage.userInfo = null;
                }
            });
            return send;
        },
        logOut:function(data){
            return $serApiSend(data, 'Login/logOut');
        },
        register:function(data){
            return $serApiSend(data, 'Login/register');
        }

    }
});
